<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>XML formats</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../index.html" TARGET="_top"><img src="images/homeImg.png"></a></p>



<h1>XML formats</h1>

<p>CoppeliaSim supports two different XML formats, where each follow a different goal:</p>
<li>an <strong>exhaustive format</strong>: the exhaustive format is a  lossless format, which means that all scene or model information will be same between a save and load operation. The drawback is however that the file should not be manually modified, since the risk of corrupting it is high. This format is ideal for version control for example.</li>
<li>a <strong>simple format</strong>: the simple format is a  lossy format, which means that not all information contained in a scene or model will be saved, only a subset of it. The advantage is however that it can be manually created and/or modified. This format is ideal for creating initial models, or for creating CoppeliaSim exporters in different applications.</li>
<p>Both formats have two variables (defined in file <em>system/usrset.txt</em>) allowing to control the output XML file:</p>
<li><em><strong>xmlExportSplitSize</strong></em>: represents the subset data size threshold where data will be referenced and written to a separate file. Set to 0 if you wish to create a single file.</li>
<li><em><strong>xmlExportKnownFormats</strong></em>: if <em>true</em>, and the export generates several files, then the <em>png</em> format for images, and the <em>dae</em> format for meshs are used. The <em>dae</em> format is however only supported with the simple xml format.</li>

<p>The exhaustive format will not be discussed further here. Refer to the generated files for additional information.</p>

<table class=subsectionTable><tr class=subsectionTd>
  <td class=subsectionTd>
<a name="simpleFormat"></a>Simple XML format
</td></tr></table> 

<p>The simple format, however its name, can contain quite complex information. Each piece of information is wrapped as <em>element</em> inside of a start- and end-<em>tag</em>. Most tags are optional (if not specified, then default values will be used). The simplest to get a good understanding of such a file's organization and which tags are not optional is to first export a scene, then examine/modify the generated file.</p>
<p>Following gives a brief overview, based on simple examples. First, a scene containing a camera attached to a dummy. Required items are indicated in red:</p>

<pre class=lightGreyBox><font color="red">&lt;CoppeliaSim&gt;</font>
  <font color="red">&lt;filetype&gt;simpleScene&lt;/filetype&gt;</font> <font color="green">(Should be simpleScene or simpleModel)</font>
  <font color="red">&lt;xmlSerializationNb&gt;1&lt;/xmlSerializationNb&gt;</font>
  &lt;environment&gt;<font color="green"> (ignored when loading a model)</font>
    ... <font color="green">(refer to generated files for details)</font>
  &lt;/environment&gt;<br>  &lt;settings&gt;<font color="green"> (ignored when loading a model)</font><br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/settings&gt;<br>  &lt;dynamics&gt;<font color="green"> (ignored when loading a model)</font><br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/dynamics&gt;<br>  &lt;simulation&gt;<font color="green"> (ignored when loading a model)</font><br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/simulation&gt;
  &lt;dummy&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
    &lt;camera&gt;<br>      ... <font color="green">(refer to generated files for details)</font>
    &lt;/camera&gt;<br>  &lt;/dummy&gt;<br><font color="red">&lt;/CoppeliaSim&gt;</font>
</pre>

<p>It is a good idea to specify a few more tags for a scene object, such as the object alias, its position/orientation relative to its parent object, and the script(s) it is associated with:</p>

<pre class=lightGreyBox>
...<br>&lt;camera&gt;<br>  &lt;common&gt;<br>    &lt;alias&gt;DefaultCamera&lt;/alias&gt;<br>    &lt;localFrame&gt;<br>      &lt;position&gt;1.120530 -1.899800 1.079718&lt;/position&gt;<br>      &lt;euler&gt;-110.932999 -28.703005 169.590027&lt;/euler&gt;<br>    &lt;/localFrame&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/common&gt;
  &lt;childScript&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>    &lt;scriptText&gt;&lt;![CDATA[<br>      function sysCall_init()<br>        print('From child script: Hello world!')<br>      end<br>    ]]&gt;&lt;/scriptText&gt;<br>  &lt;/childScript&gt;<br>  &lt;customizationScript&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>    &lt;scriptText&gt;&lt;![CDATA[<br>      function sysCall_init()<br>        print('From customization script: Hello world!')<br>      end<br>    ]]&gt;&lt;/scriptText&gt;<br>  &lt;/customizationScript&gt;<br>  ... <font color="green">(refer to generated files for details)</font>
&lt;/camera&gt;<br>...</pre>

<p>Shapes require a bit more explanations. Here a <strong>pure cuboid</strong>, i.e. a primitive shape:</p>
<pre class=lightGreyBox>
&lt;shape&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/common&gt;<br>  <font color="red">&lt;primitive&gt;</font> <font color="green">(should be compound, primitive, heightfield or mesh)</font><br>    <font color="red">&lt;type&gt;cuboid&lt;/type&gt;</font> <font color="green">(should be cuboid, sphere, cylinder, cone, plane or disc)</font><br>    &lt;size&gt;0.100000 0.100000 0.100000&lt;/size&gt;
    &lt;localFrame&gt; <font color="green">(this is in addition to the local frame you may specify in &lt;common&gt;)</font><br>      &lt;position&gt;0.000000 0.000000 0.000000&lt;/position&gt;<br>      &lt;euler&gt;-0.000000 0.000000 -0.000000&lt;/euler&gt;<br>    &lt;/localFrame&gt;
    ... <font color="green">(refer to generated files for details)</font>
  <font color="red">&lt;/primitive&gt;</font><br>  &lt;dynamics&gt;<br>    ... <font color="green">(see further below for details)</font>
  &lt;/dynamics&gt;<br>&lt;/shape&gt;</pre>

<p>Here a <strong>mesh</strong>, referencing an external file:</p>
<pre class=lightGreyBox>
&lt;shape&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/common&gt;<br>  <font color="red">&lt;mesh&gt;</font> <font color="green">(should be compound, primitive, heightfield or mesh)</font><br>    <font color="red">&lt;fileName&gt;test.simscene_mesh_Cuboid0.dae&lt;/fileName&gt;</font> <font color="green">(or vertices and indices)</font>
    &lt;localFrame&gt; <font color="green">(this is in addition to the local frame you may specify in &lt;common&gt;)</font><br>      &lt;position&gt;0.000000 0.000000 0.000000&lt;/position&gt;<br>      &lt;euler&gt;-0.000000 0.000000 -0.000000&lt;/euler&gt;<br>    &lt;/localFrame&gt;
    ... <font color="green">(refer to generated files for details)</font>
  <font color="red">&lt;/mesh&gt;</font><br>  &lt;dynamics&gt;<br>    ... <font color="green">(see further below for details)</font>
  &lt;/dynamics&gt;<br>&lt;/shape&gt;</pre>




<p>Here a <strong>mesh</strong>, with inlined mesh data:</p>
<pre class=lightGreyBox>
&lt;shape&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/common&gt;<br>  <font color="red">&lt;mesh&gt;</font> <font color="green">(should be compound, primitive, heightfield or mesh)</font>
    <font color="red">&lt;vertices&gt;0.05 -0.05 -0.05 -0.05 -0.05 -0.05 0.05 0.05 -0.05 -0.05 ...&lt;/vertices&gt;</font>
    <font color="red">&lt;indices&gt;0 1 2 2 1 3 1 0 4 1 4 5 2 3 6 6 3 7 6 7 4 4 7 5 3 1 7 7 1 5 0 2 6 0 6 4&lt;/indices&gt;</font>
    &lt;localFrame&gt; <font color="green">(this is in addition to the local frame you may specify in &lt;common&gt;)</font><br>      &lt;position&gt;0.000000 0.000000 0.000000&lt;/position&gt;<br>      &lt;euler&gt;-0.000000 0.000000 -0.000000&lt;/euler&gt;<br>    &lt;/localFrame&gt;
    ... <font color="green">(refer to generated files for details)</font>
  <font color="red">&lt;/mesh&gt;</font><br>  &lt;dynamics&gt;<br>    ... <font color="green">(see further below for details)</font>
  &lt;/dynamics&gt;<br>&lt;/shape&gt;</pre>




<p>Here a <strong>heightfield</strong>:</p>
<pre class=lightGreyBox>
&lt;shape&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/common&gt;<br>  <font color="red">&lt;heightfield&gt;</font> <font color="green">(should be compound, primitive, heightfield or mesh)</font>
    <font color="red">&lt;size&gt;4 3&lt;/size&gt;</font>
    <font color="red">&lt;data&gt;0.2 0.2 0.2 0.2 0.1 0.0 0.0 0.1 0.1 0.1 0.0 0.2&lt;/data&gt;</font>
    &lt;gridStep&gt;3.333333&lt;/gridStep&gt;
    &lt;localFrame&gt; <font color="green">(this is in addition to the local frame you may specify in &lt;common&gt;)</font><br>      &lt;position&gt;0.000000 0.000000 0.000000&lt;/position&gt;<br>      &lt;euler&gt;-0.000000 0.000000 -0.000000&lt;/euler&gt;<br>    &lt;/localFrame&gt;
    ... <font color="green">(refer to generated files for details)</font>
  <font color="red">&lt;/heightfield&gt;</font><br>  &lt;dynamics&gt;<br>    ... <font color="green">(see further below for details)</font>
  &lt;/dynamics&gt;<br>&lt;/shape&gt;</pre>




<p>And here a <strong>compound</strong>:</p>
<pre class=lightGreyBox>
&lt;shape&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font>
  &lt;/common&gt;<br>  <font color="red">&lt;compound&gt;</font> <font color="green">(should contain at least 2 of any of compound, primitive or mesh)</font>
    <font color="red">&lt;primitive&gt;</font><br>      ...<br>    <font color="red">&lt;/primitive&gt;</font><br>    <font color="red">&lt;primitive&gt;</font><br>      ...<br>    <font color="red">&lt;/primitive&gt;</font><br>    <font color="red">&lt;compound&gt;</font><br>      ...<br>    <font color="red">&lt;/compound&gt;</font><br>    ...<br>  <font color="red">&lt;/compound&gt;</font><br>  &lt;dynamics&gt;<br>    ... <font color="green">(see further below for details)</font>
  &lt;/dynamics&gt;<br>&lt;/shape&gt;</pre>




<p>If a shape has dynamic properties, you should also fill-in the dynamics tags, as in following example:</p>
<pre class=lightGreyBox>
&lt;shape&gt;<br>  ...<br>  &lt;dynamics&gt;<br>    &lt;respondableMask&gt;65535&lt;/respondableMask&gt;<br>    &lt;mass&gt;1.0&lt;/mass&gt;<br>    &lt;localInertiaFrame&gt;<br>      &lt;position&gt;0.0 0.0 0.0&lt;/position&gt;<br>      &lt;euler&gt;0.0 0.0 0.0&lt;/euler&gt;<br>    &lt;/localInertiaFrame&gt;<br>    &lt;principalMomentOfInertia&gt;0.001667 0.001667 0.001667&lt;/principalMomentOfInertia&gt;<br>    &lt;switches&gt;<br>      &lt;static&gt;false&lt;/static&gt;<br>      &lt;respondable&gt;true&lt;/respondable&gt;<br>      ... <font color="green">(refer to generated files for details)</font><br>    &lt;/switches&gt;<br>    &lt;material&gt;<br>      &lt;engines&gt;<br>        &lt;bullet&gt;<br>          &lt;friction&gt;0.5&lt;/friction&gt;<br>          &lt;oldfriction&gt;1.0&lt;/oldfriction&gt;<br>          ... <font color="green">(refer to generated files for details)</font><br>        &lt;/bullet&gt;<br>        &lt;ode&gt;<br>          &lt;friction&gt;1.0&lt;/friction&gt;<br>            ... <font color="green">(refer to generated files for details)</font><br>        &lt;/ode&gt;<br>        &lt;vortex&gt;<br>          &lt;primlinearaxisfriction&gt;1.0&lt;/primlinearaxisfriction&gt;<br>          &lt;seclinearaxisfriction&gt;1.0&lt;/seclinearaxisfriction&gt;<br>          ... <font color="green">(refer to generated files for details)</font><br>        &lt;/vortex&gt;<br>        &lt;newton&gt;<br>          &lt;staticfriction&gt;1.0&lt;/staticfriction&gt;<br>          &lt;kineticfriction&gt;1.0&lt;/kineticfriction&gt;<br>          ... <font color="green">(refer to generated files for details)</font><br>        &lt;/newton&gt;<br>      &lt;/engines&gt;<br>    &lt;/material&gt;<br>  &lt;/dynamics&gt;<br>&lt;/shape&gt;</pre>




<p>Here a revolute joint, in passive mode:</p>
<pre class=lightGreyBox>&lt;joint&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>  &lt;/common&gt;<br>  &lt;type&gt;revolute&lt;/type&gt; <font color="green">(can be revolute, prismatic or spherical)</font><br>  &lt;mode&gt;passive&lt;/mode&gt; <font color="green">(can be passive, dependent or force)</font><br>  &lt;minPosition&gt;-180.0&lt;/minPosition&gt;<br>  &lt;range&gt;360.0&lt;/range&gt;<br>  &lt;position&gt;0.0&lt;/position&gt;<br>  &lt;switches&gt;<br>    &lt;cyclic&gt;true&lt;/cyclic&gt;<br>  &lt;/switches&gt;<br>  ... <font color="green">(refer to generated files for details)</font><br>&lt;/joint&gt;</pre>




<p>Here a revolute joint, in force/torque mode, motor disabled:</p>
<pre class=lightGreyBox>&lt;joint&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>  &lt;/common&gt;<br>  &lt;type&gt;revolute&lt;/type&gt; <font color="green">(can be revolute, prismatic or spherical)</font><br>  &lt;mode&gt;force&lt;/mode&gt; <font color="green">(can be passive, ik, dependent or force)</font><br>  &lt;minPosition&gt;-180.0&lt;/minPosition&gt;<br>  &lt;range&gt;360.0&lt;/range&gt;<br>  &lt;position&gt;0.0&lt;/position&gt;<br>  &lt;switches&gt;<br>    &lt;cyclic&gt;true&lt;/cyclic&gt;<br>  &lt;/switches&gt;
  &lt;dynamics&gt;<br>    &lt;maxForce&gt;2.5&lt;/maxForce&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>    &lt;switches&gt;<br>      &lt;motorEnabled&gt;false&lt;/motorEnabled&gt;<br>      ... <font color="green">(refer to generated files for details)</font><br>    &lt;/switches&gt;<br>    &lt;engines&gt;<br>      ... <font color="green">(refer to generated files for details)</font><br>    &lt;/engines&gt;<br>  &lt;/dynamics&gt;<br>&lt;/joint&gt;</pre>




<p>Here a revolute joint, in force/torque mode, position controlled:</p>
<pre class=lightGreyBox>&lt;joint&gt;<br>  &lt;common&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>  &lt;/common&gt;<br>  &lt;type&gt;revolute&lt;/type&gt; <font color="green">(can be revolute, prismatic or spherical)</font><br>  &lt;mode&gt;force&lt;/mode&gt; <font color="green">(can be passive, ik, dependent or force)</font><br>  &lt;minPosition&gt;-180.0&lt;/minPosition&gt;<br>  &lt;range&gt;360.0&lt;/range&gt;<br>  &lt;position&gt;0.0&lt;/position&gt;<br>  &lt;switches&gt;<br>    &lt;cyclic&gt;true&lt;/cyclic&gt;<br>  &lt;/switches&gt;
  &lt;dynamics&gt;<br>    &lt;maxForce&gt;2.5&lt;/maxForce&gt;<br>    &lt;upperVelocityLimit&gt;180&lt;/upperVelocityLimit&gt;<br>    &lt;targetPosition&gt;0.0&lt;/targetPosition&gt;<br>    &lt;pidValues&gt;0.1 0.0 0.0&lt;/pidValues&gt;<br>    ... <font color="green">(refer to generated files for details)</font><br>    &lt;switches&gt;<br>      &lt;motorEnabled&gt;false&lt;/motorEnabled&gt;<br>      &lt;controlLoopEnabled&gt;true&lt;/controlLoopEnabled&gt;<br>      ... <font color="green">(refer to generated files for details)</font><br>    &lt;/switches&gt;<br>    &lt;engines&gt;<br>      ... <font color="green">(refer to generated files for details)</font><br>    &lt;/engines&gt;<br>  &lt;/dynamics&gt;<br>&lt;/joint&gt;</pre>


<p>Other scene objects are not discussed here. For details, export a scene containing such object, then examine the generated file.</p>
<p>Here a simplified version of <em>BubbleRob</em>, from <a href="bubbleRobTutorial.htm">this tutorial</a>:</p>

<pre class=lightGreyBox>
&lt;CoppeliaSim&gt;<br>    &lt;filetype&gt;simpleScene&lt;/filetype&gt;<br>  &lt;xmlSerializationNb&gt;1&lt;/xmlSerializationNb&gt;<br>  &lt;shape&gt;<br>    &lt;common&gt;<br>      &lt;alias&gt;walls&lt;/alias&gt;<br>      &lt;localFrame&gt;<br>        &lt;position&gt;0 0 0.1&lt;/position&gt;<br>        &lt;euler&gt;0 -90 0&lt;/euler&gt;<br>      &lt;/localFrame&gt;<br>      &lt;localObjectProperty&gt;<br>        &lt;selectable&gt;false&lt;/selectable&gt;<br>      &lt;/localObjectProperty&gt;<br>      &lt;localObjectSpecialProperty&gt;<br>        &lt;collidable&gt;true&lt;/collidable&gt;<br>        &lt;measurable&gt;true&lt;/measurable&gt;<br>        &lt;detectable&gt;true&lt;/detectable&gt;<br>      &lt;/localObjectSpecialProperty&gt;<br>    &lt;/common&gt;<br>    &lt;compound&gt;<br>      &lt;primitive&gt;<br>        &lt;type&gt;cuboid&lt;/type&gt;<br>        &lt;size&gt;5 0.02 0.2&lt;/size&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0 2.5 0&lt;/position&gt;<br>          &lt;euler&gt;0 90 0&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>      &lt;/primitive&gt;<br>      &lt;primitive&gt;<br>        &lt;type&gt;cuboid&lt;/type&gt;<br>        &lt;size&gt;5 0.02 0.2&lt;/size&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0 0 -2.5&lt;/position&gt;<br>          &lt;euler&gt;0 90 90&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>      &lt;/primitive&gt;<br>      &lt;primitive&gt;<br>        &lt;type&gt;cuboid&lt;/type&gt;<br>        &lt;size&gt;5 0.02 0.2&lt;/size&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0 0 2.5&lt;/position&gt;<br>          &lt;euler&gt;0 90 90&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>      &lt;/primitive&gt;<br>      &lt;primitive&gt;<br>        &lt;type&gt;cuboid&lt;/type&gt;<br>        &lt;size&gt;5 0.02 0.2&lt;/size&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0 -2.5 0&lt;/position&gt;<br>          &lt;euler&gt;0 90 0&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>      &lt;/primitive&gt;<br>    &lt;/compound&gt;<br>    &lt;dynamics&gt;<br>      &lt;switches&gt;<br>        &lt;static&gt;true&lt;/static&gt;<br>        &lt;respondable&gt;true&lt;/respondable&gt;<br>      &lt;/switches&gt;<br>    &lt;/dynamics&gt;<br>  &lt;/shape&gt;<br>  &lt;shape&gt;<br>    &lt;common&gt;<br>      &lt;alias&gt;obstacle&lt;/alias&gt;<br>      &lt;localFrame&gt;<br>        &lt;position&gt;1 0 0.1&lt;/position&gt;<br>      &lt;/localFrame&gt;<br>      &lt;localObjectSpecialProperty&gt;<br>        &lt;collidable&gt;true&lt;/collidable&gt;<br>        &lt;measurable&gt;true&lt;/measurable&gt;<br>        &lt;detectable&gt;true&lt;/detectable&gt;<br>      &lt;/localObjectSpecialProperty&gt;<br>    &lt;/common&gt;<br>    &lt;primitive&gt;<br>      &lt;type&gt;cuboid&lt;/type&gt;<br>      &lt;size&gt;0.2 0.2 0.2&lt;/size&gt;<br>    &lt;/primitive&gt;<br>    &lt;dynamics&gt;<br>      &lt;switches&gt;<br>        &lt;static&gt;true&lt;/static&gt;<br>        &lt;respondable&gt;true&lt;/respondable&gt;<br>      &lt;/switches&gt;<br>    &lt;/dynamics&gt;<br>  &lt;/shape&gt;<br>  &lt;light&gt;<br>    &lt;common&gt;<br>      &lt;alias&gt;light&lt;/alias&gt;<br>      &lt;localFrame&gt;<br>        &lt;position&gt;0 0 2&lt;/position&gt;<br>        &lt;euler&gt;100 -50 0&lt;/euler&gt;<br>      &lt;/localFrame&gt;<br>    &lt;/common&gt;<br>    &lt;type&gt;directional&lt;/type&gt;<br>    &lt;color&gt;<br>      &lt;light&gt;<br>        &lt;ambientDiffuse&gt;127 127 127&lt;/ambientDiffuse&gt;<br>      &lt;/light&gt;<br>    &lt;/color&gt;<br>  &lt;/light&gt;<br>  &lt;shape&gt;<br>    &lt;common&gt;<br>      &lt;alias&gt;bubbleRob&lt;/alias&gt;<br>      &lt;localFrame&gt;<br>        &lt;position&gt;0 0 0.12&lt;/position&gt;<br>      &lt;/localFrame&gt;<br>      &lt;localObjectSpecialProperty&gt;<br>        &lt;collidable&gt;true&lt;/collidable&gt;<br>        &lt;measurable&gt;true&lt;/measurable&gt;<br>        &lt;detectable&gt;true&lt;/detectable&gt;<br>      &lt;/localObjectSpecialProperty&gt;<br>      &lt;switches&gt;<br>        &lt;modelBase&gt;true&lt;/modelBase&gt;<br>      &lt;/switches&gt;<br>    &lt;/common&gt;<br>    &lt;primitive&gt;<br>      &lt;type&gt;sphere&lt;/type&gt;<br>      &lt;size&gt;0.2 0.2 0.2&lt;/size&gt;<br>      &lt;color&gt;<br>        &lt;ambientDiffuse&gt;255 167 36&lt;/ambientDiffuse&gt;<br>      &lt;/color&gt;<br>    &lt;/primitive&gt;<br>    &lt;dynamics&gt;<br>      &lt;respondableMask&gt;65295&lt;/respondableMask&gt;<br>      &lt;mass&gt;4&lt;/mass&gt;<br>      &lt;principalMomentOfInertia&gt;0.004 0.004 0.004&lt;/principalMomentOfInertia&gt;<br>      &lt;switches&gt;<br>        &lt;static&gt;false&lt;/static&gt;<br>        &lt;respondable&gt;true&lt;/respondable&gt;<br>      &lt;/switches&gt;<br>    &lt;/dynamics&gt;<br>    &lt;childScript&gt;<br>      &lt;scriptText&gt;&lt;![CDATA[
function sysCall_init()<br>  leftMotor=sim.getObjectHandle('./bubbleRobLeftMotor')<br>  rightMotor=sim.getObjectHandle('./bubbleRobRightMotor')<br>  noseSensor=sim.getObjectHandle('./bubbleRobSensingNose')<br>  driveBackTime=0<br>end<br><br>function sysCall_actuation()<br>  if driveBackTime&amp;gt;0 then<br>    driveBackTime=driveBackTime-sim.getSimulationTimeStep()<br>  end<br>  local result=sim.readProximitySensor(noseSensor)<br>  if result&amp;gt;0 then<br>    driveBackTime=3<br>    sim.setJointTargetVelocity(leftMotor,-math.pi*0.5)<br>    sim.setJointTargetVelocity(rightMotor,-math.pi*0.25)<br>  end<br>  if driveBackTime&amp;lt;=0 then<br>    sim.setJointTargetVelocity(leftMotor,math.pi)<br>    sim.setJointTargetVelocity(rightMotor,math.pi)<br>  end<br>end
  ]]&gt;&lt;/scriptText&gt;<br>    &lt;/childScript&gt;<br>    &lt;proximitySensor&gt;<br>      &lt;common&gt;<br>        &lt;alias&gt;bubbleRobSensingNose&lt;/alias&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0.1 0 0&lt;/position&gt;<br>          &lt;euler&gt;0 90 90&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>        &lt;localObjectProperty&gt;<br>          &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>        &lt;/localObjectProperty&gt;<br>      &lt;/common&gt;<br>      &lt;type&gt;cone&lt;/type&gt;<br>      &lt;size&gt;0.01&lt;/size&gt;<br>      &lt;volume&gt;<br>        &lt;range&gt;0.15&lt;/range&gt;<br>        &lt;smallestAllowedDistance&gt;0.01&lt;/smallestAllowedDistance&gt;<br>        &lt;angle&gt;60&lt;/angle&gt;<br>      &lt;/volume&gt;<br>    &lt;/proximitySensor&gt;<br>    &lt;joint&gt;<br>      &lt;common&gt;<br>        &lt;alias&gt;bubbleRobLeftMotor&lt;/alias&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0.05 0.1 -0.08&lt;/position&gt;<br>          &lt;euler&gt;-90 0 0&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>        &lt;localObjectProperty&gt;<br>          &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>        &lt;/localObjectProperty&gt;<br>      &lt;/common&gt;<br>      &lt;type&gt;revolute&lt;/type&gt;<br>      &lt;mode&gt;force&lt;/mode&gt;<br>      &lt;switches&gt;<br>        &lt;cyclic&gt;true&lt;/cyclic&gt;<br>      &lt;/switches&gt;<br>      &lt;sizes&gt;<br>        &lt;length&gt;0.15&lt;/length&gt;<br>        &lt;diameter&gt;0.02&lt;/diameter&gt;<br>      &lt;/sizes&gt;<br>      &lt;dynamics&gt;<br>        &lt;maxForce&gt;2.5&lt;/maxForce&gt;<br>        &lt;upperVelocityLimit&gt;360&lt;/upperVelocityLimit&gt;<br>        &lt;switches&gt;<br>          &lt;motorEnabled&gt;true&lt;/motorEnabled&gt;<br>        &lt;/switches&gt;<br>      &lt;/dynamics&gt;<br>      &lt;shape&gt;<br>        &lt;common&gt;<br>          &lt;alias&gt;bubbleRobLeftWheel&lt;/alias&gt;<br>          &lt;localObjectProperty&gt;<br>            &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>          &lt;/localObjectProperty&gt;<br>          &lt;localObjectSpecialProperty&gt;<br>            &lt;collidable&gt;true&lt;/collidable&gt;<br>            &lt;measurable&gt;true&lt;/measurable&gt;<br>            &lt;detectable&gt;true&lt;/detectable&gt;<br>          &lt;/localObjectSpecialProperty&gt;<br>        &lt;/common&gt;<br>        &lt;primitive&gt;<br>          &lt;type&gt;cylinder&lt;/type&gt;<br>          &lt;size&gt;0.08 0.08 0.02&lt;/size&gt;<br>          &lt;color&gt;<br>            &lt;ambientDiffuse&gt;64 64 64&lt;/ambientDiffuse&gt;<br>          &lt;/color&gt;<br>        &lt;/primitive&gt;<br>        &lt;dynamics&gt;<br>          &lt;mass&gt;0.8&lt;/mass&gt;<br>          &lt;principalMomentOfInertia&gt;0.0004 0.0004 0.0008&lt;/principalMomentOfInertia&gt;<br>          &lt;switches&gt;<br>            &lt;static&gt;false&lt;/static&gt;<br>            &lt;respondable&gt;true&lt;/respondable&gt;<br>          &lt;/switches&gt;<br>        &lt;/dynamics&gt;<br>      &lt;/shape&gt;<br>    &lt;/joint&gt;<br>    &lt;joint&gt;<br>      &lt;common&gt;<br>        &lt;alias&gt;bubbleRobRightMotor&lt;/alias&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;0.05 -0.1 -0.08&lt;/position&gt;<br>          &lt;euler&gt;-90 0 0&lt;/euler&gt;<br>        &lt;/localFrame&gt;<br>        &lt;localObjectProperty&gt;<br>          &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>        &lt;/localObjectProperty&gt;<br>      &lt;/common&gt;<br>      &lt;type&gt;revolute&lt;/type&gt;<br>      &lt;mode&gt;force&lt;/mode&gt;<br>      &lt;switches&gt;<br>        &lt;cyclic&gt;true&lt;/cyclic&gt;<br>      &lt;/switches&gt;<br>      &lt;sizes&gt;<br>        &lt;length&gt;0.15&lt;/length&gt;<br>        &lt;diameter&gt;0.02&lt;/diameter&gt;<br>      &lt;/sizes&gt;<br>      &lt;dynamics&gt;<br>        &lt;maxForce&gt;2.5&lt;/maxForce&gt;<br>        &lt;upperVelocityLimit&gt;360&lt;/upperVelocityLimit&gt;<br>        &lt;switches&gt;<br>          &lt;motorEnabled&gt;true&lt;/motorEnabled&gt;<br>        &lt;/switches&gt;<br>      &lt;/dynamics&gt;<br>      &lt;shape&gt;<br>        &lt;common&gt;<br>          &lt;alias&gt;bubbleRobRightWheel&lt;/alias&gt;<br>          &lt;localObjectProperty&gt;<br>            &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>          &lt;/localObjectProperty&gt;<br>          &lt;localObjectSpecialProperty&gt;<br>            &lt;collidable&gt;true&lt;/collidable&gt;<br>            &lt;measurable&gt;true&lt;/measurable&gt;<br>            &lt;detectable&gt;true&lt;/detectable&gt;<br>          &lt;/localObjectSpecialProperty&gt;<br>        &lt;/common&gt;<br>        &lt;primitive&gt;<br>          &lt;type&gt;cylinder&lt;/type&gt;<br>          &lt;size&gt;0.08 0.08 0.02&lt;/size&gt;<br>          &lt;color&gt;<br>            &lt;ambientDiffuse&gt;64 64 64&lt;/ambientDiffuse&gt;<br>          &lt;/color&gt;<br>        &lt;/primitive&gt;<br>        &lt;dynamics&gt;<br>          &lt;mass&gt;0.8&lt;/mass&gt;<br>          &lt;principalMomentOfInertia&gt;0.0004 0.0004 0.0008&lt;/principalMomentOfInertia&gt;<br>          &lt;switches&gt;<br>            &lt;static&gt;false&lt;/static&gt;<br>            &lt;respondable&gt;true&lt;/respondable&gt;<br>          &lt;/switches&gt;<br>        &lt;/dynamics&gt;<br>      &lt;/shape&gt;<br>    &lt;/joint&gt;<br>    &lt;forceSensor&gt;<br>      &lt;common&gt;<br>        &lt;alias&gt;bubbleRobLink&lt;/alias&gt;<br>        &lt;localFrame&gt;<br>          &lt;position&gt;-0.07 0 -0.07&lt;/position&gt;<br>        &lt;/localFrame&gt;<br>        &lt;localObjectProperty&gt;<br>          &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>        &lt;/localObjectProperty&gt;<br>      &lt;/common&gt;<br>      &lt;size&gt;0.05&lt;/size&gt;<br>      &lt;shape&gt;<br>        &lt;common&gt;<br>          &lt;alias&gt;bubbleRobCaster&lt;/alias&gt;<br>          &lt;localFrame&gt;<br>            &lt;position&gt;0 0 -0.025&lt;/position&gt;<br>          &lt;/localFrame&gt;<br>          &lt;localObjectProperty&gt;<br>            &lt;selectModelBaseInstead&gt;true&lt;/selectModelBaseInstead&gt;<br>          &lt;/localObjectProperty&gt;<br>          &lt;localObjectSpecialProperty&gt;<br>            &lt;collidable&gt;true&lt;/collidable&gt;<br>            &lt;measurable&gt;true&lt;/measurable&gt;<br>            &lt;detectable&gt;true&lt;/detectable&gt;<br>          &lt;/localObjectSpecialProperty&gt;<br>        &lt;/common&gt;<br>        &lt;primitive&gt;<br>          &lt;type&gt;sphere&lt;/type&gt;<br>          &lt;size&gt;0.05 0.05 0.05&lt;/size&gt;<br>          &lt;color&gt;<br>            &lt;ambientDiffuse&gt;55 55 55&lt;/ambientDiffuse&gt;<br>          &lt;/color&gt;<br>        &lt;/primitive&gt;<br>        &lt;dynamics&gt;<br>          &lt;respondableMask&gt;65520&lt;/respondableMask&gt;<br>          &lt;mass&gt;0.5&lt;/mass&gt;<br>          &lt;principalMomentOfInertia&gt;0.00025 0.00025 0.00025&lt;/principalMomentOfInertia&gt;<br>          &lt;switches&gt;<br>            &lt;static&gt;false&lt;/static&gt;<br>            &lt;respondable&gt;true&lt;/respondable&gt;<br>          &lt;/switches&gt;<br>          &lt;material&gt;<br>            &lt;engines&gt;<br>              &lt;bullet&gt;<br>                &lt;friction&gt;0&lt;/friction&gt;<br>              &lt;/bullet&gt;<br>              &lt;ode&gt;<br>                &lt;friction&gt;0&lt;/friction&gt;<br>              &lt;/ode&gt;<br>              &lt;vortex&gt;<br>                &lt;primlinearaxisfriction&gt;0&lt;/primlinearaxisfriction&gt;<br>                &lt;seclinearaxisfriction&gt;0&lt;/seclinearaxisfriction&gt;<br>              &lt;/vortex&gt;<br>              &lt;newton&gt;<br>                &lt;staticfriction&gt;0&lt;/staticfriction&gt;<br>                &lt;kineticfriction&gt;0&lt;/kineticfriction&gt;<br>              &lt;/newton&gt;<br>            &lt;/engines&gt;<br>          &lt;/material&gt;<br>        &lt;/dynamics&gt;<br>      &lt;/shape&gt;<br>    &lt;/forceSensor&gt;<br>  &lt;/shape&gt;<br>  &lt;camera&gt;<br>    &lt;common&gt;<br>      &lt;alias&gt;camera&lt;/alias&gt;<br>      &lt;localFrame&gt;<br>        &lt;position&gt;0.952512 1.344827 0.718737&lt;/position&gt;<br>        &lt;euler&gt;114.251228 -20.888456 9.124518&lt;/euler&gt;<br>      &lt;/localFrame&gt;<br>    &lt;/common&gt;<br>    &lt;mainCamera&gt;true&lt;/mainCamera&gt;<br>  &lt;/camera&gt;<br>  &lt;shape&gt;<br>    &lt;common&gt;<br>      &lt;alias&gt;floor&lt;/alias&gt;<br>      &lt;localFrame&gt;<br>        &lt;position&gt;0 0 -0.02&lt;/position&gt;<br>      &lt;/localFrame&gt;<br>      &lt;localObjectProperty&gt;<br>        &lt;selectable&gt;false&lt;/selectable&gt;<br>      &lt;/localObjectProperty&gt;<br>      &lt;localObjectSpecialProperty&gt;<br>        &lt;collidable&gt;true&lt;/collidable&gt;<br>        &lt;measurable&gt;true&lt;/measurable&gt;<br>        &lt;detectable&gt;true&lt;/detectable&gt;<br>      &lt;/localObjectSpecialProperty&gt;<br>    &lt;/common&gt;<br>    &lt;primitive&gt;<br>      &lt;type&gt;cuboid&lt;/type&gt;<br>      &lt;size&gt;5 5 0.04&lt;/size&gt;<br>      &lt;color&gt;<br>        &lt;ambientDiffuse&gt;209 209 209&lt;/ambientDiffuse&gt;<br>      &lt;/color&gt;<br>    &lt;/primitive&gt;<br>    &lt;dynamics&gt;<br>      &lt;switches&gt;<br>        &lt;static&gt;true&lt;/static&gt;<br>        &lt;respondable&gt;true&lt;/respondable&gt;<br>      &lt;/switches&gt;<br>    &lt;/dynamics&gt;<br>  &lt;/shape&gt;<br>&lt;/CoppeliaSim&gt;
</pre>


<br>
<br>
 </tr>
 <tr>
   <td > 
 </tr>
</table> 
</div>  
  
  
</body>

</html>
